<template>
<div class="">
    <div class="pr10">
        <div class="analyItem">
            <p class="analyItemTit tx-center">状态</p>
            <div class="analyItemCon">

            </div>
        </div>
    </div>
    <div class="thinScroll pr10" v-scrollHeight="84">
    <router-link tag="div" exact :to="routerPath('threeSheAnswer')" class=" analyItem anItemBor" active-class="anItemBor-active">
            <p class="analyItemTit tx-center">设置</p>
            <div class="analyItemCon">
                    <p class="col-md-6">
                        <span class="col-md-12 cLightGray pr8">设置</span>
                    </p>
            </div>
    </router-link>
    <template v-if="answerList.length>0">
        <router-link tag="div"   exact :to="{path:routerPath('threeWenAnswer'), query:{ anSolution:item.anSolution }} " v-for="(item,index) in answerList" :key="index" class=" analyItem anItemBor" active-class="anItemBor-active">
                <p class="analyItemTit tx-center">问题</p>
                <div class="analyItemCon">
                        <p class="col-md-6">
                            <span class="col-md-12 cLightGray pr8">{{ item. anProblem}}</span>
                        </p>
                </div>
        </router-link>
    </template>
    </div>
        <div class=" analyItem">
                <p class="analyItemTit tx-center">处理</p>
                <div class="analyItemCon tx-center">
                </div>
    </div>
</div>
</template>
<script>
import { mapGetters, mapMutations } from 'vuex'
import { getAnswerList } from '../Resources/Api/index'
export default {
    data () {
        return {
            answerList: []
        }
    },
    created () {
        this.getAnswerList()
    },
    computed: {
        ...mapGetters(['leftInfo', 'updatePlate'])
    },
    methods: {
        ...mapMutations({
            setUpdatePlate: `SET_UPDATE_PLATE`
        }),
        getAnswerList () {
            getAnswerList({
                stId: this.leftInfo.stId
                // uid: this.leftInfo.uid // this.leftInfo.uid
            }).then(res => {
                if (res.data.StatusCode === 0) {
                    this.answerList = res.data.Body.answers
                }
            }).catch(err => {
                console.log(err)
            })
        },
        // 路由跳转路径拼接
        routerPath (path) {
            return this.$route.matched[1].path + '/' + path
        },
        // 直接进行路由跳转路径
        routerPush (path) {
            this.$router.push(this.$route.matched[1].path + '/' + path)
        }
    },
    watch: {
        updatePlate () {
            this.getAnswerList()
        },
        leftInfo () {
            // if (this.leftInfo !== null && this.leftInfo !== undefined && this.leftInfo !== '') {
            this.getAnswerList()
            // }
        }
    }
}
</script>
